#include <iostream>
#include <string>
#include <assert.h>

#include "ExternalSorter.h"

using namespace std;

int main(int argc, char* argv[])
{
	if (argc == 3) {
		string inputFileName = argv[1];
		string outputFileName = argv[2];
		ExternalSorter sorter(inputFileName);
		sorter.Sort(outputFileName);
	} else if (argc == 2) {
		ofstream file(argv[1], ios_base::binary);
		assert(file);
		for (size_t i = 0; i < 1000 * 1000 * 1000; i++) {
			int value = rand();
			file.write((char*)(&value), sizeof(value));
		}
	}
	return 0;
}